package cn.wen.yaling.commons.utils;import cn.wen.yaling.commons.dto.UserDTO;/** * @ClassName: UserHolder * @Author: 小飞 * @Date: 2023/4/16 13:53 * @Description: 存储当前线程的的用户信息 */public class UserHolder {    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();    public static void saveUser(UserDTO user){        tl.set(user);    }    public static UserDTO getUser(){        return tl.get();    }    public static void removeUser(){        tl.remove();    }}